package com.kmzx.one.project.config.listener;

import com.kmzx.one.project.events.CancelOrderEvent;
import com.kmzx.one.project.mapper.UserOrderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

@Component("CancelOrderEventListener")
public class CancelOrderEventListener {

    // CancelOrderEvent
    @Autowired
    private UserOrderMapper userOrderMapper;


    @Async
    @EventListener(classes = {CancelOrderEvent.class})
    @Transactional(rollbackFor = Exception.class)
    public void CancelOrderEventListener(CancelOrderEvent cancelOrderEvent) {
        String orderId = cancelOrderEvent.getOrderId();
    }
}
